package com.xuecheng.media.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 小班哥
 * @version 1.0
 * @date 2023/3/25 12:17
 * @description ThisClassExplain
 */

@Configuration
public class MinIoConfig {

    @Value("${minio.endpoint}")
    private String endpoint;

    @Value("${minio.accessKey}")
    private String user;

    @Value("${minio.secretKey}")
    private String password;


    @Bean
    public MinioClient minioClient(){
        MinioClient minioClient = MinioClient.builder().endpoint(endpoint).credentials(user , password).build();
        return minioClient;
    }
}
